package com.emergency.embackend.mapper;

import com.emergency.embackend.entity.QuizHistory;
import com.emergency.embackend.param.QuizSuitParam;
import com.emergency.embackend.vo.QuizSortVO;
import com.emergency.embackend.vo.QuizSuitVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

/**
 * @author chddd
 * @description
 * @create 2024/3/13 19:14:59
 */
@Mapper
public interface QuizHistoryMapper {
    /**
     * 插入相关记录数据
     * @param quizHistory
     */
    void insert(QuizHistory quizHistory);

    /**
     * 获取用户排行
     * @param date
     * @return
     */
    List<QuizSortVO> getSort(Date date);

    /**
     * 获取用户通过的题库
     * @param param
     * @param userId
     * @return
     */
    List<QuizSuitVO> getUserPassHistory(@Param("param") QuizSuitParam param,@Param("userId") Long userId);

    /**
     * 获取做了但没有通过的题库
     * @param param
     * @param userId
     * @return
     */
    List<QuizSuitVO> getUnPassHistory(@Param("param")QuizSuitParam param,@Param("userId") Long userId);

    Long getDataInWeek(Long id);

    Long getDataInMonth(Long id);

    List<QuizSuitVO> getHistory(Long userId);
}
